import scrapy

class Hs(scrapy.Spider):

    name = 'hs'
    custom_settings = {
            'DEFAULT_REQUEST_HEADERS' : {
                'auth': 'eyJoYXNoIjoibWQ1IiwiYWxnIjoiSFMyNTYiLCJ0eXAiOiJKV1QifQ.eyJzaWQiOiI0NGIwNDhiOS1hNzBkLTRjN2EtOTg4MS1lYTkzYWNlNzIyZjciLCJleHBpcmUiOjE1Mzk3Njk1NDJ9.sJLrNp4SUj-waiwqMC2xa83O9T8RZ3R5OnHn2JqKhXQ',
                'User-Agent': 'Mozilla/5.0 (Linux; Android 4.4.2; OPPO R11 Build/NMF26X) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36 MicroMessenger/6.6.7.1321(0x26060736) NetType/WIFI Language/zh_CN MicroMessenger/6.6.7.1321(0x26060736) NetType/WIFI Language/zh_CN',
                'Host': 'www.xiaohongshu.com',
        }
    }
    fans_url = 'https://www.xiaohongshu.com/sapi/wx_mp_api/sns/v1/user/%s/followers?start=&sid=session.1221344937852575358'
    fllow = 'https://www.xiaohongshu.com/sapi/wx_mp_api/sns/v1/user/%s/followings?start=&sid=session.1221344937852575358'
    info_url = ''

    def start_requests(self):
        base_url = self.fans_url % '56584f2482718c73b99e720d'
        yield scrapy.Request(base_url, callback=self.parse_list)

    def parse_list(self,response):
        print(response.text)

